<?php
/*
* Copyright (c) 2010 by Cediti
*
* You may distribute under the terms of either the GNU Lesser General
* Public License or the new BSD License, as specified in the README file.
*/

// created :    25/01/2010
// version :    21/04/2010

interface Cmis_Services_Object extends Cmis_Services_Interface
{
	/**
	 * Creates a document object of the specified type (given by the cmis:objectTypeId property) in the (optionally) specified location.
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
     * @param array properties The property values that MUST be applied to the
     *  newly-created Document Object.
     * @param Cmis_Repository_Id folderId If specified, the identifier for the
     *  folder that MUST be the parent folder for the newly-created Document Object
     *  This parameter MUST be specified if the Repository does NOT support the
     *  optional "unfiling" capability.
     * @param array $contentStream The Content Stream that MUST be stored
     *  for the newly-created Document Object. The method of passing the contentStream
     *  to the server and the encoding mechanism will be specified by each specific
     *  binding.  MUST be required if the type requires it. (array(mimetype, base64_encoded data))
     * @param Enum $versioningState An enumeration specifying what the versioing
     *  state of the newly-created object MUST be. If the repository does not
     *  support versioning, the repository MUST ignore the versioningState
     *  parameter.  Valid values are:
     *    o none:  The document MUST be created as a non-versionable document.
     *    o checkedout: The document MUST be created in the checked-out state.
     *    o major (default): The document MUST be created as a major version
     *    o minor: The document MUST be created as a minor version.
     * @param array $policies A list of policy IDs that MUST be applied to the
     *  newly-created Document object.
     * @param array[ACE] $addACEs A list of ACEs that MUST be added to the
     *  newly-created Document object, either using the ACL from folderId if
     *  specified, or being applied if no folderId is specified.
     * @param array[ACE] $removeACEs A list of ACEs that MUST be removed from
     *  the newly-created Document object, either using the ACL from folderId if
     *  specified, or being ignored if no folderId is specified.
	 * @return Cmis_Repository_Id The ID of the newly-created document.
	 */
	public function createDocument(Cmis_Repository_Id $repositoryId, Cmis_Repository_Properties $properties, Cmis_Repository_Id $folderId = null, array $contentStream = null, $versioningState = 'major', array $policies = null, array $addACEs = null, array $removeACEs = null);

	/**
	 * Creates a folder object of the specified type in the specified location.
	 *
	 * @param Cmis_Repository_Id $repositoryId The identifier for the Repository.
	 * @param array $properties The property values that MUST be applied to the
	 *  newly-created Folder Object.
	 * @param Cmis_Repository_Id $folderId The identifier for the folder that
	 *  MUST be the parent folder for the newly-created Folder Object.
	 * @param array $policies A list of policy IDs that MUST be applied to the
	 *  newly-created Folder object.
	 * @param array[ACE] $addACEs A list of ACEs that MUST be added to the
	 *  newly-created Folder object, either using the ACL from folderId if
	 *  specified, or being applied if no folderId is specified.
	 * @param array[ACE] $removeACEs A list of ACEs that MUST be removed from the
	 *  newly-created Folder object, either using the ACL from folderId if
	 *  specified, or being ignored if no folderId is specified.
	 * @return Cmis_Repository_Entry
	 */
	public function createFolder(Cmis_Repository_Id $repositoryId, Cmis_Repository_Properties $properties, Cmis_Repository_Id $folderId, array $policies = null, array $addACEs = null, array $removeACEs = null);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef typeId
	 * @param undef properties
	 * @param undef sourceObjectId
	 * @param undef targetObjectId
	 * @return Cmis_Response
	 */
	public function createRelationship(Cmis_Repository_Id $repositoryId, $typeId, $properties, $sourceObjectId, $targetObjectId);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef typeId
	 * @param undef properties
	 * @param undef folderId
	 * @return Cmis_Response
	 */
	public function createPolicy(Cmis_Repository_Id $repositoryId, $typeId, $properties, $folderId);

	/**
	 * Gets the list of allowable actions for an Object 
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param Cmis_Repository_Id objectId The identifier for the object
	 * @return Cmis_Repository_AllowableActions
	 */
	public function getAllowableActions(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId);

	/**
	 * Gets the list of properties for an Object.
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param Cmis_Repository_Id objectId the identifier for the object
	 * @param string filter See section 2.2.1.2.1 Properties
	 * @return Cmis_Repository_Properties
	 */
	public function getProperties(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId, $filter = null);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef objectId
	 * @return Cmis_Response
	 */
	public function getContentStream(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId, $streamId = null);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef objectId
	 * @param undef changeToken
	 * @param undef propertyCollection
	 * @return Cmis_Response
	 */
	public function updateProperties(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId, $changeToken, $propertyCollection);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef objectId
	 * @param undef targetFolderId
	 * @param undef sourceFolderId
	 * @return Cmis_Response
	 */
	public function moveObject(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId, $targetFolderId, $sourceFolderId);

	/**
	 * Deletes the specified object
	 * @param Cmis_Repository_Id $repositoryId The identifier for the Repository
	 * @param Cmis_Repository_Id $objectId The identifier of the object to be deleted
	 * @param bool $allVersions If TRUE (default), then delete all versions of the
	 *  document. If FALSE, delete only the document object specified. The
	 *  Repository MUST ignore the value of this parameter when this service is
	 *  invoke on a non-document object or non-versionable document object.
	 * @return void
	 */
	public function deleteObject(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId, $allVersions = true);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef folderId
	 * @param undef unfileNonfolderObjects
	 * @return Cmis_Response
	 */
	public function deteleTree(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $folderId, $unfileNonfolderObjects);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef objectId
	 * @param undef overwriteFlag
	 * @param undef content
	 * @param undef properties
	 * @return Cmis_Response
	 */
	public function setContentStream(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId, $overwriteFlag, $content, $properties);

	/**
	 *
	 *
	 * @param Cmis_Repository_Id repositoryId The identifier for the Repository
	 * @param undef objectId
	 * @return Cmis_Response
	 */
	public function deleteContentStream(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId);

    /**
     * Gets the specified information for the Object
     * @param Cmis_Repository_Id $repositoryId The identifier for the Repository.
     * @param Cmis_Repository_Id $objectId The identifier for the object
     * @param string $filter Property Filter
     * @param Enum $includeRelationships Include relationships
     * @param bool $includePolicyIds Include Policy Ids
     * @param Enum $renditionFiltery
     * @param bool $includeACL Include ACLs
     * @param bool $includeAllowableActions
     * @return Cmis_Repository_Entry
     */
    public function getObject(Cmis_Repository_Id $repositoryId, Cmis_Repository_Id $objectId, $filter = null, $includeRelationships = null, $includePolicyIds = false, $renditionFilter = null, $includeACL = false, $includeAllowableActions = false);

    /**
     * Gets the specified object.
     * @param Cmis_Repository_Id $repositoryId
     * @param string $path
     * @param string $filter
     * @param bool $includeAllowableActions
     * @param Enum $includeRelationships
     * @param bool $renditionFilter
     * @param bool $includePolicyIds
     * @param bool $includeACL
     * @return Cmis_Repository_Entry
     */
    public function getObjectByPath(Cmis_Repository_Id $repositoryId, $path, $filter = null, $includeAllowableActions = false, $includeRelationships = null, $renditionFilter = null, $includePolicyIds = false, $includeACL = false);
}

# EOF
